remove last N element from an array javascript

join shbcf.ru